home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Text / WASTE / WASTE 1.1.2 Distribution / Pseudo-UPI for THINK Pascal / Controls.p < prev    next >
Encoding:
Text File  |  1995-10-12  |  3.7 KB  |  167 lines  |  [TEXT/PJMM]

  1. unit Controls;
  2.  
  3. { Pascal Interface to the Macintosh Libraries }
  4.  
  5. { Copyright © Apple Computer Inc. }
  6. { All Rights Reserved }
  7.  
  8. { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
  9.  
  10. interface
  11.     uses
  12.         Types;
  13.  
  14.     type
  15.  
  16.         ControlPartCode = UInt8;
  17.         ControlHiliteValue = UInt8;
  18.  
  19.     const
  20.         kControlNoPart = 0;
  21.         kControlLabelPart = 1;
  22.         kControlMenuPart = 2;
  23.         kControlTrianglePart = 4;
  24.         kControlButtonPart = 10;
  25.         kControlCheckBoxPart = 11;
  26.         kControlRadioButtonPart = 11;
  27.         kControlUpButtonPart = 20;
  28.         kControlDownButtonPart = 21;
  29.         kControlPageUpPart = 22;
  30.         kControlPageDownPart = 23;
  31.         kControlIndicatorPart = 129;
  32.         kControlDisabledPart = 254;
  33.         kControlInactivePart = 255;
  34.  
  35.         kControlCheckboxUncheckedValue = 0;
  36.         kControlCheckboxCheckedValue = 1;
  37.         kControlCheckboxMixedValue = 2;
  38.  
  39.         kControlRadioButtonUncheckedValue = 0;
  40.         kControlRadioButtonCheckedValue = 1;
  41.         kControlRadioButtonMixedValue = 2;
  42.  
  43.     type
  44.  
  45.         ControlDefProcMessage = SInt16;
  46.  
  47.     const
  48.  
  49.         drawCntl = 0;
  50.         testCntl = 1;
  51.         calcCRgns = 2;
  52.         initCntl = 3;
  53.         dispCntl = 4;
  54.         posCntl = 5;
  55.         thumbCntl = 6;
  56.         dragCntl = 7;
  57.         autoTrack = 8;
  58.         calcCntlRgn = 10;
  59.         calcThumbRgn = 11;
  60.         drawThumbOutline = 12;
  61.  
  62. { Control color table part codes}
  63.         cFrameColor = 0;
  64.         cBodyColor = 1;
  65.         cTextColor = 2;
  66.         cThumbColor = 3;
  67.  
  68.     type
  69.         ControlRef = ControlHandle;
  70.  
  71.         ControlDefProcPtr = ProcPtr;  { FUNCTION ControlDef(varCode: INTEGER; theControl: ControlRef; message: INTEGER; param: LONGINT): LONGINT; }
  72.         ControlActionProcPtr = ProcPtr;  { PROCEDURE ControlAction(theControl: ControlRef; partCode: INTEGER); }
  73.         ControlDefUPP = UniversalProcPtr;
  74.         ControlActionUPP = UniversalProcPtr;
  75.  
  76.     const
  77.         uppControlDefProcInfo = $00003BB0; { FUNCTION (2 byte param, 4 byte param, 2 byte param, 4 byte param): 4 byte result; }
  78.         uppControlActionProcInfo = $000002C0; { PROCEDURE (4 byte param, 2 byte param); }
  79.  
  80.     function NewControlDefProc (userRoutine: ControlDefProcPtr): ControlDefUPP;
  81.     inline
  82.         $2E9F;
  83.  
  84.     function NewControlActionProc (userRoutine: ControlActionProcPtr): ControlActionUPP;
  85.     inline
  86.         $2E9F;
  87.  
  88.     function CallControlDefProc (varCode: INTEGER;
  89.                                     theControl: ControlRef;
  90.                                     message: INTEGER;
  91.                                     param: LONGINT;
  92.                                     userRoutine: ControlDefUPP): LONGINT;
  93.     inline
  94.         $205F, $4E90;
  95.  
  96.     procedure CallControlActionProc (theControl: ControlRef;
  97.                                     partCode: INTEGER;
  98.                                     userRoutine: ControlActionUPP);
  99.     inline
  100.         $205F, $4E90;
  101.  
  102.     procedure SetControlTitle (theControl: ControlRef;
  103.                                     title: ConstStr255Param);
  104.     inline
  105.         $A95F;
  106.  
  107.     procedure GetControlTitle (theControl: ControlRef;
  108.                                     var title: Str255);
  109.     inline
  110.         $A95E;
  111.  
  112.     procedure SetControlValue (theControl: ControlRef;
  113.                                     theValue: INTEGER);
  114.     inline
  115.         $A963;
  116.  
  117.     function GetControlValue (theControl: ControlRef): INTEGER;
  118.     inline
  119.         $A960;
  120.  
  121.     procedure SetControlMinimum (theControl: ControlRef;
  122.                                     minValue: INTEGER);
  123.     inline
  124.         $A964;
  125.  
  126.     function GetControlMinimum (theControl: ControlRef): INTEGER;
  127.     inline
  128.         $A961;
  129.  
  130.     procedure SetControlMaximum (theControl: ControlRef;
  131.                                     maxValue: INTEGER);
  132.     inline
  133.         $A965;
  134.  
  135.     function GetControlMaximum (theControl: ControlRef): INTEGER;
  136.     inline
  137.         $A962;
  138.  
  139.     procedure SetControlReference (theControl: ControlRef;
  140.                                     data: LONGINT);
  141.     inline
  142.         $A95B;
  143.  
  144.     function GetControlReference (theControl: ControlRef): LONGINT;
  145.     inline
  146.         $A95A;
  147.  
  148.     procedure SetControlAction (theControl: ControlRef;
  149.                                     actionProc: ControlActionUPP);
  150.     inline
  151.         $A96B;
  152.  
  153.     function GetControlAction (theControl: ControlRef): ControlActionUPP;
  154.     inline
  155.         $A96A;
  156.  
  157.     procedure SetControlColor (theControl: ControlRef;
  158.                                     newColorTable: CCTabHandle);
  159.     inline
  160.         $AA43;
  161.  
  162.     function GetControlVariant (theControl: ControlRef): INTEGER;
  163.     inline
  164.         $A809;
  165.  
  166. implementation
  167. end.